Skip to content

Design preview for code example voting #2810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rohitpaulk
Copy link
Member

@rohitpaulk rohitpaulk commented Apr 23, 2025

Summary by CodeRabbit

  • New Features
    • Introduced a feedback section at the bottom of community solution cards, enabling users to upvote or downvote solutions with immediate visual confirmation.
  • Style
    • Enhanced layout and interactive button styling, including dark mode support and smooth animated transitions.
  • Refactor
    • Relocated upvote and downvote buttons from the header to the new feedback section for improved user experience.

Copy link
Contributor

coderabbitai bot commented Apr 23, 2025

"""

Walkthrough

A feedback feature was introduced to the community solution card within the course page. The upvote and downvote buttons, previously located in the card header, have been removed from there and a new feedback section component has been added at the bottom of the card. This feedback section provides interactive upvote and downvote buttons, visually reflects user actions, and displays a temporary thank-you message upon voting. The new component handles vote state and UI transitions internally, utilizing tracked properties and animated feedback.

Changes

File(s) Change Summary
app/components/course-page/course-stage-step/community-solution-card/content.hbs Renders the new <FeedbackSection> component after the unchanged file comparisons section.
app/components/course-page/course-stage-step/community-solution-card/feedback-section.hbs,
.../community-solution-card/feedback-section.ts
New feedback section component: UI for upvote/downvote, state management, animated transitions, and thank-you message.
app/components/course-page/course-stage-step/community-solution-card/header.hbs Removes (comments out) the upvote/downvote buttons from the header, indicating relocation to the card's bottom.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CommunitySolutionCard
    participant FeedbackSection

    User->>CommunitySolutionCard: Views solution card
    CommunitySolutionCard->>FeedbackSection: Renders feedback section
    User->>FeedbackSection: Clicks "Helpful" or "Not helpful"
    FeedbackSection->>FeedbackSection: Updates vote state
    FeedbackSection->>FeedbackSection: Shows "Thanks for your feedback!" (1.5s)
    FeedbackSection-->>User: Visual feedback (button highlight, message)
Loading

Poem

A rabbit hopped through code today,
Moving buttons out of the way.
Now at the bottom, feedback shines—
With up and down in tidy lines.
Click "Yes" or "No," a thank-you glows,
For helpful thoughts the user shows!
🐇✨
"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 1fd42e4 and c4f2f92.

📒 Files selected for processing (4)
  • app/components/course-page/course-stage-step/community-solution-card/content.hbs (1 hunks)
  • app/components/course-page/course-stage-step/community-solution-card/feedback-section.hbs (1 hunks)
  • app/components/course-page/course-stage-step/community-solution-card/feedback-section.ts (1 hunks)
  • app/components/course-page/course-stage-step/community-solution-card/header.hbs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • app/components/course-page/course-stage-step/community-solution-card/content.hbs
  • app/components/course-page/course-stage-step/community-solution-card/header.hbs
  • app/components/course-page/course-stage-step/community-solution-card/feedback-section.hbs
  • app/components/course-page/course-stage-step/community-solution-card/feedback-section.ts

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@rohitpaulk rohitpaulk force-pushed the update-course-page-code-examples-test branch 2 times, most recently from eb19b4a to 8a5f787 Compare April 23, 2025 00:25
Copy link

github-actions bot commented Apr 23, 2025

Test Results

  1 files  ±0    1 suites  ±0   8m 19s ⏱️ -58s
624 tests ±0  576 ✅  - 3  45 💤 ±0  0 ❌ ±0  3 🔥 +3 
624 runs  ±0  573 ✅  - 6  45 💤 ±0  3 ❌ +3  3 🔥 +3 

For more details on these errors, see this check.

Results for commit c4f2f92. ± Comparison against base commit c9b1151.

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Apr 23, 2025

❌ 3 Tests Failed:

Tests completed Failed Passed Skipped
579 3 576 45
View the top 3 failed test(s) by shortest run time
Chrome 135.0 Acceptance | view-badges: it renders when all badges are unearned
Stack Traces | 1.27s run time
Promise rejected during "it renders when all badges are unearned": Failed to visit URL '/badges': ChunkLoadError: Loading chunk vendors-assets__route__badges_js failed.
(error: http://localhost:7357/assets/chunk.3208a847fb0336699f6a.js)

PageObject: 'page.visit()'
  Selector: ':first'
Chrome 135.0 Acceptance | course-page | code-examples | vote: can upvote code examples
Stack Traces | 1.6s run time
Promise rejected during "can upvote code examples": Element not found.

PageObject: 'page.codeExamplesTab.solutionCards[0].upvoteButton'
  Selector: '[data-test-code-examples-tab] [data-test-community-solution-card]:eq(0) [data-test-solution-card-upvote-button]'

PageObject: 'page.codeExamplesTab.solutionCards[0].upvoteButton.hover()'
  Selector: '[data-test-code-examples-tab] [data-test-community-solution-card]:eq(0) [data-test-solution-card-upvote-button]'
Chrome 135.0 Acceptance | course-page | code-examples | vote: can downvote code examples
Stack Traces | 1.71s run time
Promise rejected during "can downvote code examples": Element not found.

PageObject: 'page.codeExamplesTab.solutionCards[0].downvoteButton'
  Selector: '[data-test-code-examples-tab] [data-test-community-solution-card]:eq(0) [data-test-solution-card-downvote-button]'

PageObject: 'page.codeExamplesTab.solutionCards[0].downvoteButton.hover()'
  Selector: '[data-test-code-examples-tab] [data-test-community-solution-card]:eq(0) [data-test-solution-card-downvote-button]'

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Copy link

codecov bot commented Apr 23, 2025

Bundle Report

Changes will increase total bundle size by 1.12kB (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
client-array-push 36.58MB 1.12kB (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/chunk.*.js 1.12kB 49.98kB 2.3%

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0813f20 and c16d008.

📒 Files selected for processing (4)
  • app/components/course-page/course-stage-step/community-solution-card/content.hbs (1 hunks)
  • app/components/course-page/course-stage-step/community-solution-card/feedback-section.hbs (1 hunks)
  • app/components/course-page/course-stage-step/community-solution-card/feedback-section.ts (1 hunks)
  • app/components/course-page/course-stage-step/community-solution-card/header.hbs (1 hunks)
🧰 Additional context used
🪛 GitHub Check: codecov/patch
app/components/course-page/course-stage-step/community-solution-card/feedback-section.ts

[warning] 23-24: app/components/course-page/course-stage-step/community-solution-card/feedback-section.ts#L23-L24
Added lines #L23 - L24 were not covered by tests


[warning] 26-26: app/components/course-page/course-stage-step/community-solution-card/feedback-section.ts#L26
Added line #L26 was not covered by tests


[warning] 29-31: app/components/course-page/course-stage-step/community-solution-card/feedback-section.ts#L29-L31
Added lines #L29 - L31 were not covered by tests


[warning] 38-39: app/components/course-page/course-stage-step/community-solution-card/feedback-section.ts#L38-L39
Added lines #L38 - L39 were not covered by tests


[warning] 41-41: app/components/course-page/course-stage-step/community-solution-card/feedback-section.ts#L41
Added line #L41 was not covered by tests


[warning] 44-46: app/components/course-page/course-stage-step/community-solution-card/feedback-section.ts#L44-L46
Added lines #L44 - L46 were not covered by tests


[warning] 50-52: app/components/course-page/course-stage-step/community-solution-card/feedback-section.ts#L50-L52
Added lines #L50 - L52 were not covered by tests

🔇 Additional comments (1)
app/components/course-page/course-stage-step/community-solution-card/feedback-section.hbs (1)

1-42: Feedback section UI looks good

The UI implementation for the feedback section is well designed with appropriate animations and visual state changes for different voting conditions.

refactor(feedback): increase animation duration for voting feedback
fix: improve feedback section text clarity and consistency
feat: add tooltips to feedback buttons for clarity
feat(tooltip): add delay to tooltips for improved usability
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant